
const fs = require('fs');


function readAccountsFromFileSync(_fullPath) {
    let accounts = [];
    if (fs.existsSync(_fullPath)) {
        let accountsJson = fs.readFileSync(_fullPath, 'utf8');
        accounts = JSON.parse(accountsJson);
    }
    return accounts;
}

function writeAccountsToFileSync(_fullPath, accounts) {
    fs.writeFileSync(_fullPath, JSON.stringify(accounts), 'utf8');
    return true;
}

module.exports = {
    readAccountsFromFileSync,
    writeAccountsToFileSync
}